# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo5.14
# Description:
# Author:       $赵怡蕾
# Date:         2019/2/14
#-------------------------------------------------------------------------------


# 截取字符串前后空格，运行结果：geekori.com
print("  geekori.com  ".strip())
# 截取字符串前后空格，运行结果：<  geekori.com  >
print("  <  geekori.com  >  ".strip())

langList = ["Python","java","ruby","scala","perl"]
lang = "  Python  "
# lang前后带有空格，因此无法在langList中找到相应的元素
if lang in langList:
    print("<找到了python>")
else:
    print("<未找到python>")
# 将lang前后空格去掉，可以再langList中找到相应的元素
if lang.strip() in langList:
    print("{找到了python}")
else:
    print("{未找到python}")
# 指定要截取字符串前后的字符是空格、*和&，运行结果：Hello& *World
print("***  &* Hello& *World**&&&".strip(" *&"))